from sqlalchemy.ext.declarative import declarative_base,AbstractConcreteBase

from environment import environment,engine

Base = declarative_base(engine)

# 解决错误does not have a __table__ or __tablename__ specified and does not inherit from an existing table-mapped class.
# 添加 AbstractConcreteBase 继承或者在类中添加__abstract__ = True 表明当前类只用于继承
class BaseModel(AbstractConcreteBase,Base):
    
    @classmethod
    def db(self):
        return environment.db

    # 批量增加
    # 批量删除
    # 批量修改